package com.yuyou.tas.admin.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuyou.tas.admin.mapper.CommNoMapper;
import com.yuyou.tas.admin.service.ICommNoService;
import com.yuyou.tas.service.api.admin.entity.CommNo;

@Service
public class CommNoServiceImpl implements ICommNoService{

	@Autowired
	private CommNoMapper commNoMapper;
	
	@Override
	@Transactional(rollbackFor=Exception.class,timeout=60)
	public int generNo(int type) {
		commNoMapper.selectByTypeLock(type);
		commNoMapper.generNo(type);
		CommNo commNo=commNoMapper.selectByTypeLock(type);
		return commNo.getNo();
	}
	

}